/// \file Renderer.h
/// \date 2012-12-08
/// \brief abstract class that offers the rendering and graphics device related functionality

#ifndef _TORUSPRORENDERING_RENDER_RENDERER_H__
#define _TORUSPRORENDERING_RENDER_RENDERER_H__

#include <vector>
#include <string>

#include <AppModel/Include/Torus.h>

#include <Render/Include/Mesh.h>
#include <Render/Include/Texture.h>

namespace Render
{
/// \brief abstract class that offers the rendering and graphics device related functionality
/// \details it is intended to be specialized in different platforms as desired, DX9, DX10, OpenGL
class Renderer
{
public:
    /// \brief simple vertex description
    typedef struct
    {
        float position_x;
        float position_y;
        float position_z;
        float normal_x;
        float normal_y;
        float normal_z;
        float tex_coords_u;
        float tex_coords_v;        
    }VertexData;

    /// \brief index data description
    typedef unsigned int IndexData;

    // ========== LIFECYCLE ========== //
    /// \brief Destructor
    virtual ~Renderer(void);

    // ========== OVERLODED OPERATORS ========== //

    // ========== METHODS ========== //
    
    /// \brief abstract method to render a torus
    virtual void renderTorus(AppModel::Torus* torus) = 0;
    
    /// \brief sets the arc ball camera parameters
    void configArcBallCamera(float theta, float phi, float radio);

    // \brief abstract method to create a texture
    virtual Texture* createTexture(const char* file) = 0;

    // \brief abstract method to create a mesh
    virtual Mesh* createMesh(VertexData* vertex_data, const unsigned int &vertex_count, IndexData* index_data, const unsigned int &index_count) = 0;

    // ========== GETTERS ========== //

    // ========== SETTERS ========== //

    // ========== INQUIRY ========== //

protected:
    // ========== INTERNAL METHODS ========== //
    
    /// \brief Constructor
    Renderer(void);

    // ========== ATTRIBUTES ========== //
      
    /// \brief arc ball camera theta
    float arc_ball_camera_theta;

    /// \brief arc ball camera phi
    float arc_ball_camera_phi;

    /// \brief arc ball camera radio
    float arc_ball_camera_radio;

};
};
#endif // _TORUSPRORENDERING_RENDER_RENDERER_H__
